package com.nariano.server.services.mapservice;

import java.util.List;

import com.nariano.server.domain.entities.Area;
import com.nariano.server.domain.entities.AreaBoundaries;
import com.nariano.server.domain.entities.Location;
import com.nariano.server.domain.entities.Population;
import com.nariano.server.domain.entities.PopulationType;
import com.nariano.server.domain.entities.User;
import com.nariano.server.utils.aop.rwsemaphore.ReadTransaction;
import com.nariano.server.utils.aop.rwsemaphore.WriteTransaction;


public interface MapService {
    
	@WriteTransaction
    void createMap(int size);
    
	@WriteTransaction
    void deleteMap();

	@ReadTransaction
    List<Area> getAreas();
    
	@ReadTransaction
    Area getArea(Location location);

	@ReadTransaction
    List<List<Area>> getAreas(Location center, int width);

    @WriteTransaction
    void updateAreas(Area ... a);
    
    @ReadTransaction
    AreaBoundaries getBoundaries();

    @ReadTransaction
	Area getArea(Integer id);

    @ReadTransaction
	int getPopulationCount(Integer user, PopulationType type);

    @WriteTransaction
	Population moveOutRandomPopulation(Integer user);

    @ReadTransaction
	List<Population> getPopulation(Integer user);

}
